![]() |
Kinetis SDK API Reference Manual
1.0.0-beta
Freescale Semiconductor, Inc.
|
#include "fsl_spi_features.h"#include "fsl_device_registers.h"#include <stdint.h>#include <stdbool.h>#include <assert.h>Data Structures | |
| struct | spi_config_t |
| SPI hardware configuration settings. More... | |
Functions | |
Configuration | |
| void | spi_hal_init (uint32_t instance, const spi_config_t *config) |
| Configures the SPI peripheral. | |
| void | spi_hal_reset (uint32_t instance) |
| Restores the SPI to reset the configuration. | |
| static void | spi_hal_enable (uint32_t instance) |
| Enables the SPI peripheral. | |
| static void | spi_hal_disable (uint32_t instance) |
| Disables the SPI peripheral. | |
| void | spi_hal_set_baud (uint32_t instance, uint32_t kbitsPerSec) |
| Sets the SPI baud rate in kilobits per second. | |
| static void | spi_hal_set_baud_divisors (uint32_t instance, uint32_t prescaleDivisor, uint32_t rateDivisor) |
| Configures the baud rate divisors manually. | |
| static void | spi_hal_set_master_slave (uint32_t instance, spi_master_slave_mode_t mode) |
| Configures the SPI for master or slave. | |
| void | spi_hal_set_slave_select_output_mode (uint32_t instance, spi_ss_output_mode_t mode) |
| Sets how the slave select output operates. | |
| void | spi_hal_set_data_format (uint32_t instance, spi_clock_polarity_t polarity, spi_clock_phase_t phase, spi_shift_direction_t direction) |
| Sets the polarity, phase, and shift direction. | |
| void | spi_hal_set_pin_mode (uint32_t instance, spi_pin_mode_t mode) |
| Sets the SPI pin mode. | |
DMA | |
| void | spi_hal_configure_dma (uint32_t instance, bool enableTransmit, bool enableReceive) |
| Configures the transmit and receive DMA requests. | |
Low power | |
| static void | spi_hal_configure_stop_in_wait_mode (uint32_t instance, bool enable) |
| Enables or disables the SPI clock to stop when the CPU enters wait mode. | |
Interrupts | |
| static void | spi_hal_enable_receive_and_fault_interrupt (uint32_t instance) |
| Enables the receive buffer full and mode fault interrupt. | |
| static void | spi_hal_disable_receive_and_fault_interrupt (uint32_t instance) |
| Disables the receive buffer full and mode fault interrupt. | |
| static void | spi_hal_enable_transmit_interrupt (uint32_t instance) |
| Enables the transmit buffer empty interrupt. | |
| static void | spi_hal_disable_transmit_interrupt (uint32_t instance) |
| Disables the transmit buffer empty interrupt. | |
| static void | spi_hal_enable_match_interrupt (uint32_t instance) |
| Enables the match interrupt. | |
| static void | spi_hal_disable_match_interrupt (uint32_t instance) |
| Disables the match interrupt. | |
Status | |
| static bool | spi_hal_is_read_buffer_full (uint32_t instance) |
| Checks whether the read buffer is full. More... | |
| static bool | spi_hal_is_transmit_buffer_empty (uint32_t instance) |
| Checks whether the transmit buffer is empty. More... | |
| static bool | spi_hal_is_mode_fault (uint32_t instance) |
| Checks whether a mode fault occurred. | |
| void | spi_hal_clear_mode_fault (uint32_t instance) |
| Clears the mode fault flag. | |
| static bool | spi_hal_is_match (uint32_t instance) |
| Checks whether the data received matches the previously-set match value. | |
| void | spi_hal_clear_match (uint32_t instance) |
| Clears the match flag. | |
Data transfer | |
| static uint8_t | spi_hal_read_data (uint32_t instance) |
| Reads a byte from the data buffer. | |
| static void | spi_hal_write_data (uint32_t instance, uint8_t data) |
| Writes a byte into the data buffer. | |
Match byte | |
| static void | spi_hal_set_match_value (uint32_t instance, uint8_t matchByte) |
| Sets the value which triggers the match interrupt. | |